package ltd.bugs.cute.test.base.spring;

import org.junit.runner.RunWith;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * 未设置开发
 * 
 * @author zhengzhq
 *
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ActiveProfiles(profiles = {"test"})
@ContextConfiguration(
    locations = {"classpath*:spring_test.xml", "classpath*:spring_test_extra.xml"})
public class SpringBase implements ApplicationContextAware {
  protected ApplicationContext context;

  /**
   * 实现ApplicationContextAware接口的context注入函数, 将其存入静态变量.
   */
  public void setApplicationContext(ApplicationContext context) {
    this.context = context;
  }
}
